
from appium.webdriver.common.appiumby import AppiumBy

from base.base_object import Home_object
class Home_page(Home_object):
    #点击放大镜
    def home_search_bar_click(self,driver):
        return self.click_new(
            driver=driver,
            by=AppiumBy.XPATH,
            value=self.home_search_bar_button()
        )
    #输入内容
    def home_search_bar_sendkeys(self,driver,text):
        return self.send_keys_new(
            driver=driver,
            by=AppiumBy.XPATH,
            value=self.home_search_bar_textview(),
            text=text
        )
    #组装成业务
    def home_search_step(self,driver,text):
        self.home_search_bar_click(driver)
        self.home_search_bar_sendkeys(driver,text)


if __name__ == '__main__':
    import time
    from appium.webdriver.common.appiumby import AppiumBy
    from config.comm_driver import CommonDriver
    from page.authorize_page import Authorize_page
    dr=CommonDriver().get_driver()
    Authorize_page().authorize_step(dr)
    Home_page().home_search_step(dr,'纸牌屋')
    time.sleep(5)
    Home_page().home_search_step(dr,'血族')